﻿<UserControl x:Class="CitiSurface.DocViewerControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:cs="clr-namespace:CitiSurface"
             xmlns:s="http://schemas.microsoft.com/surface/2008"
             mc:Ignorable="d" x:Name="root"
             d:DesignHeight="300" d:DesignWidth="300">
    <!--Customized UserControl for Document when it is in ScatterView-->
    <UserControl.Resources>
        <ResourceDictionary>
            <Storyboard x:Key="ControlPanelFadein">
                <DoubleAnimation Storyboard.TargetName="CancelButton"
                            Storyboard.TargetProperty="Opacity"
                            From="0" To="1" Duration="0:0:1"/>
            </Storyboard>

            <Storyboard x:Key="ControlPanelFadeout">
                <DoubleAnimation Storyboard.TargetName="CancelButton"
                            Storyboard.TargetProperty="Opacity"
                            From="1" To="0" Duration="0:0:1"/>
            </Storyboard>
        </ResourceDictionary>
    </UserControl.Resources>
    
    <Grid Background="White">
        <Grid  Margin="10,10"
               TouchDown="GridTouchDown">
            <Grid.RowDefinitions>
                <RowDefinition Height="80"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Image Grid.Row="0" Source="{Binding ScreenshotSource}" HorizontalAlignment="Center"
                   Stretch="Uniform"/>

            <Label Grid.Row="1" x:Name="Title" Content="{Binding Name}" Foreground="Black"
                   FontSize="14" FontWeight="ExtraBlack"/>

            <s:SurfaceScrollViewer Grid.Row="2" 
                                   Foreground="DarkGray" 
                                   BorderBrush="DarkGray"
                                   CanContentScroll="False"
                                   HorizontalScrollBarVisibility="Disabled"
                                   >
                <Label x:Name="Contenr" Content="{Binding Content}" Foreground="DarkGray"
                       FontSize="12"/>
            </s:SurfaceScrollViewer>
        </Grid>

        <cs:CitiSurfaceButton HorizontalAlignment="Right" VerticalAlignment="Top"
                              x:Name="CancelButton" Click="CancelButtonClick"
                              Visibility="Collapsed" Source="Resources/cancel_black.png"/>
    </Grid>
</UserControl>
